package pri.hillchen.std.design.pattern.single;

/**
 * Created by hillchen on 2018/3/7.
 */
public class LazySynchronized {
    private LazySynchronized(){
    }
    private static LazySynchronized lazySynchronized = null;

    /**
     * 添加synchronized同步，可能导致性能降低
     * @return
     */
    public synchronized static LazySynchronized getInstance(){
        if(lazySynchronized == null){
            lazySynchronized = new LazySynchronized();
        }
        return lazySynchronized;
    }
}
